﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Veteran_cms.Models.HomeListViewModel>" %>
<%@ Import Namespace="THS.HtmlHelpers" %>

  <div role="main" id="content">
  <%if (Model != null)
    {
        if (Model.ArticleList .Count>0)
        {
        int countId = 0; foreach (var item in Model.ArticleList)
                          { %>
				<!-- Start photosgallery-captions -->
				<div id="headlines">
					<div id="headlines-carousel-wrapper">
						<section id="headlines-carousel">
                        
							<article id="<%=countId %>">
							<%=Html.FriendlyImageUrl(item.image_thumbnail,"chi_tiet","tin_tuc",new RouteValueDictionary{{"id",item.article_id},{"title",Url.EncodeFriendlyUrl(item.title)}},new Dictionary<string,string>{{"class","img-wrapper"}}) %>
								<div class="text-wrapper">
									<header>
						                <div class="cat-item">
											<span class="cat-link"><a href="#">Categories</a></span>
											<span class="cat-date"><%=item.show_date.ToString("dd-MM-yyyy")%></span>
										</div>								
										<h4 class="title"><%=Html.FriendlyTextUrl(item.title, "chi_tiet", "tin_tuc", new RouteValueDictionary { { "id", item.article_id }, { "title", Url.EncodeFriendlyUrl(item.title) } })%></h4>
									</header>
									<div class="description">
										<p><%=item.sub_title%></p></div>
                                         <div class="comment-item">
										<span class="comment-link"><a href="#"><%=item.num_comments%> Comments</a></span>
										<span class="likes-link"><a href="#">4 Likes</a></span>
									</div>	
								</div>
							</article>
						</section>
                       
					</div>
				</div> <%} %>
				<!-- // end of photosgallery-captions -->
				   <div class="divider_line"></div>
					        <div class="pagination wp-pagenavi" style="text-align:right">
                                    <%=Ajax.Pager(Model.PageInfo.CurrentPage, Model.PageInfo.TotalItems, "articleList", Convert.ToInt32(Model.ArticleList[0].category_id), Model.PageInfo.ItemsPerPage, "Paging")%>
					        </div>
                            <%}
    } %>	
				
				
				<!-- widget area #1 on homepage -->
                <%if (Model.TopNewsReaded.Count > 0)
                  {
                      var firstItem=Model.TopNewsReaded[0]; %>
				<div class="widget-ext widget-area" role="complementary">
					
					
					<aside class="widget widget_post_list_ext wide">
						<div class="widget-inner-container">
							<div class="widget-title">
								<h5 class="wt">XEM NHIỀU NHẤT</h5>
							</div>
					        <div class="widget-inner-content">
					            <div class="large-post-type">
					                <div class="img-item"><%=Html.FriendlyImageUrl(firstItem.image_large,"chi_tiet","tin_tuc",new RouteValueDictionary{{"id",firstItem.article_id},{"title",Url.EncodeFriendlyUrl(firstItem.title)}}) %></div>
									<div class="content-draft">
						                <div class="cat-item">
											<span class="cat-date"><%=firstItem.show_date.ToString("dd-MM-yyyy") %></span>
										</div>
						                <h5 class="title-item">
						                	<%=Html.FriendlyTextUrl(firstItem.title,"chi_tiet","tin_tuc",new RouteValueDictionary{{"id",firstItem.article_id},{"title",Url.EncodeFriendlyUrl(firstItem.title)}}) %>
						                </h5>
						                <div class="entry-item"><p><%=firstItem.sub_title %></p><p><%=Html.FriendlyTextUrl("Xem chi tiết","chi_tiet","tin_tuc",new RouteValueDictionary{{"id",firstItem.article_id},{"title",Url.EncodeFriendlyUrl(firstItem.title)}},new Dictionary<string,string>{{"class","more-link"}}) %></p></div>
									</div>
					            </div> <!-- /. end of large-post-type -->
								<ul class="list-small-post-type">
                                <%foreach (var item in Model.TopNewsReaded)
                                  {
                                      if (item.article_id == firstItem.article_id)
                                          continue;
                                       %>
								    <li>
								        <div class="img-item"><%=Html.FriendlyImageUrl(item.image_thumbnail,"chi_tiet","tin_tuc",new RouteValueDictionary{{"id",item.article_id},{"title",Url.EncodeFriendlyUrl(item.title)}}) %></div>
								        <div class="content-draft">
							                <div class="cat-item">
												<span class="cat-date"><%=item.show_date.ToString("dd-MM-yyyy") %></span>
											</div>
							                <h5 class="title-item">
							                	<%=Html.FriendlyTextUrl(item.title,"chi_tiet","tin_tuc",new RouteValueDictionary{{"id",item.article_id},{"title",Url.EncodeFriendlyUrl(item.title)}}) %>
							                </h5>										
										</div>
								    </li>
								    <%} %>
								</ul>
					        </div>
						</div>
					</aside>				
					
					
				</div>
				
				<%} %>


			
      
    </div>
   